home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
pctj8408.arc
/
RANDOM8.BAS
< prev
next >
Wrap
BASIC Source File
|
1984-05-11
|
898b
|
37 lines
10 ' Random number generator demonstration
20 ' Coordinates of points in the display are
30 ' derived from using successive random
40 ' numbers generated by RND but randomized.
50 ' -by P. F. Hultquist, 1983
60 '
61 DIM ARRAY(50)
62 GOSUB 1000
70 SCREEN 2 : KEY OFF : CLS
80 FOR K = 1 TO 5000
85 GOSUB 2000
90 I = 80 + 465*V
95 GOSUB 2000
100 J = 35 + 130*V
110 PSET(I,J)
120 NEXT K
130 '
140 ' Arrange display
150 '
160 LINE (25,10) - (600,10)
170 LINE -(600,190)
180 LINE -(25,190)
190 LINE -(25,10)
200 LOCATE 23,35
210 PRINT "Figure 7"
220 END
1000 FOR K = 1 TO 50 'Initialization of the
1010 ARRAY(K) = RND 'randomizer
1020 NEXT K
1030 SPARE = RND
1040 RETURN
2000 ' Randomizer
2010 KA = INT(50*SPARE) + 1
2020 SPARE = ARRAY(KA) : V = SPARE
2030 ARRAY(KA) = RND
2040 RETURN